<layout name="popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">
	<div class="popup-header">
		<h1>添加成员</h1>
		<i class="mid"></i>
		<a class="btn btn-normal" onclick="save();">确定</a>
		<a class="btn btn-return" onclick="close_popup();">取消</a>
	</div>
	<div class="popup-body">
		<div class="popup-body-scroll">
			<div class="popup-content">
				<div class="table">
					<ul>
						<li class="thead">
							<span class="w3"><label class="checkbox">
									<input type="checkbox"class="toggle-select-all" data="id[]" />
									<i class="icon"></i> </label></span>
							<span class="w10">员工编号</span>
							<span class="w19">姓名</span>
							<span class="w10 x1">部门</span>
							<span class="w10">职位</span>
						</li>
						<if condition="empty($user_list)">
							<li class="no-data">
								没找到数据
							</li>
						</if>
						<form id="form_data" name="form_data" method="post" >
							<input type="hidden" name="group_id" id="group_id" value="{$group_id}">
							<foreach name="user_list" val="vo">
								<li class="tbody">
									<span class="w3"><label class="checkbox">
											<input  type="checkbox" name="id[]" value="{$vo.id}" />
											<i class="icon"></i></label></span>
									<span class="w10">{$vo.emp_no}</span>
									<span class="w19 ">{$vo.name}</span>
									<span class="w10 x1">{$vo.dept_name}&nbsp;</span>
									<span class="w10">{$vo.position_name}</span>
								</li>
							</foreach>
						</form>
					</ul>
				</div>
			</div>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use(['global'], function() {
			var fn = {
				save : function() {
					if ($("input:checked[name='id[]']").length < 1) {
						layer.msg("请选择用户");
						return false;
					};
					send_form('form_data', '{:url("save_user")}', '', function(ret) {
						if (ret.status == 1) {
							parent.layer.msg(ret.info, {
								time : 1200
							}, function() {
								parent.layer.close(index);
								parent.location.reload(true);
							});
						} else {
							parent.layer.msg(ret.info);
							return false;
						};
					});
				},
				close_popup : function() {
					parent.layer.close(index);
				}
			};
			win_exp(fn);
		});

	</script>
</block>